package yfdc;
import com.google.gson.annotations.Expose;
import org.jetbrains.annotations.Contract;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.annotations.NotNull;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public abstract class JavaBean extends Object implements java.io.Serializable {
	@Expose(serialize = false, deserialize = false) private transient static final long serialVersionUID = 0L;
	public JavaBean() {
		super();
	}
	@Override public String toString(){
		return GsonFactory.getGson().toJson(this);
	}
	public static String toString(JavaBean bean) throws JsonException {
		String str = "";
		try {
			str = GsonFactory.getGson().toJson(bean, bean.getClass());
		} catch (Throwable ex) {
			throw new JsonException(ex);
		}
		return str;
	}
	private static void ignore(){
		//this method does nothing.
	}
	@Contract("null -> !null") @NotNull public static String stackTrace(@Nullable final Throwable exception) {
		String rtn = null;
		if (exception == null) {
			return "<null>";
		} else {
			java.io.StringWriter var1 = new java.io.StringWriter(100);
			java.io.PrintWriter var2 = new java.io.PrintWriter(var1, false);
			exception.printStackTrace(var2);
			rtn = var1.toString();
			kotlin.jvm.internal.Intrinsics.checkNotNull(rtn, "rtn returns null");
			try {
				var1.close();
				var2.close();
				var1.flush();
				var2.flush();
			} catch (Throwable var1000) {
				ignore();
				//ignored
				/*
				* //ignored code does nothing
				* */
			}
		}
		return rtn;
	}
}
